﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="PrivRoleManager.aspx.cs" Inherits="StoragePeriod.Web.SysManage.PrivRoleManager" %>
<%@ Register src="UC_PrivMenu.ascx" tagname="UC_PrivMenu" tagprefix="uc1" %>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
    .layout{ background:url(../images/images_59.jpg) no-repeat;}
    .left-cloumn{display:none;}
    .right-cloumn{width:944px;}
    #sms_title_li_0{ background:url(../images/images_55.jpg) no-repeat;}
    .Left_Search{width:190px;padding-left:10px; height:30px;border-top:1px solid #ccc;}
    .right_Stafflist{ overflow:auto;}
</style>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainLeft" runat="server">
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="MainContent" runat="server">
<div class="sms_title">
    <ul>
        <li><a href="OperationManage.aspx">基础设置</a></li>
        <li><a href="PrivilegeManage.aspx" style="color:#f90;">权限管理</a></li>
        <li><a href="PersonnelManage.aspx">人员管理</a></li>
    </ul>
</div>
<div class="sms_main">
    <div class="BasicData_left">
        <h2>权限设置</h2>
        <uc1:UC_PrivMenu ID="UC_PrivMenu1" runat="server" ShowId="2"/>
    </div>
    <div class="BasicData_right">
        <asp:HiddenField ID="hfRoleCode" runat="server" />
<div class="BasicDataBtn" style="margin-bottom: 10px;">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                角色名称:
            </td>
            <td>
                <asp:TextBox runat="server" ID="txt_roleName" />
            </td>
            <td>
                角色描述:
            </td>
            <td>
                <asp:TextBox runat="server" ID="txt_roledesc" />
            </td>
            <td>
                <asp:Button Text="添加角色" runat="server" ID="btAddRole" OnClick="btAddRole_Click" />
            </td>
            <td>
                <asp:Button Text="删除角色" runat="server" ID="btDeleteRole" OnClick="btDeleteRole_Click" />
            </td>
            <td>
                <asp:Button Text="修改角色" runat="server" ID="btModfiyRole" OnClick="btModfiyRole_Click" />
            </td>
            <td>
                <asp:Button Text="保存权限" runat="server" ID="btSavePrivilege" OnClick="btSavePrivilege_Click" />
            </td>
            <td style="width: 10px;">
            </td>
        </tr>
    </table>
</div>
<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td valign="top">
            <div class="sp-box-list">
                <h3 class="sp-title">
                    角色列表</h3>
                <ul style="width: 150px; height: 345px; overflow-x: hidden; overflow-y: auto;">
                    <asp:Repeater runat="server" ID="repRoleList">
                        <ItemTemplate>
                            <li>
                                <asp:LinkButton Text='<%#Eval("Name") %>' ToolTip='<%#Eval("Name") %>' CommandArgument='<%#Eval("Value") %>'
                                    ID="roleAct" OnClick="roleAct_Click" runat="server" />
                            </li>
                        </ItemTemplate>
                    </asp:Repeater>
                </ul>
            </div>
        </td>
        <td width="10">
        </td>
        <td valign="top">
            <div style="width: 528px;" class="sp-box">
                <div class="sp-top-panel">
                    <h3>
                        权限模块</h3>
                </div>
                <div style="width: 528px; height: 345px; overflow-x: hidden; overflow-y: auto;">
                    <asp:Repeater runat="server" ID="repPrivModule" OnItemDataBound="repPrivModule_ItemDataBound">
                        <ItemTemplate>
                            <div class="sp-priv-sub-box border line-height25">
                                <div class="sp-title">
                                    <%# Eval("CategoryName") %>
                                </div>
                                <div class="sp-sub-box">
                                    <asp:Repeater runat="server" ID="subPageList" OnItemDataBound="subPageList_ItemDataBound">
                                        <ItemTemplate>
                                            <div class="sp-page">
                                                <b>
                                                    <asp:CheckBox Text='<%# Eval("PageName") %>' PrivType='<%# Eval("PrivType") %>' PrivCode='<%# Eval("Value") %>'
                                                        ID="PageViewPrivilege" runat="server" />
                                                </b>
                                                <asp:CheckBoxList OnDataBound="subPrivs_ItemDataBound" Style="margin-left: 2em;"
                                                    ID="subPrivs" runat="server" RepeatDirection="Horizontal">
                                                </asp:CheckBoxList>
                                            </div>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </div>
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
            </div>
        </td>
    </tr>
</table>
<script type="text/javascript">
    $("[id*=PageViewPrivilege]").click(function () {
        $(this).parents("div.sp-page").find("input[type=checkbox]").attr('checked', this.checked);
    })
    $("[id*=subPrivs] input[type=checkbox]").click(function () {
        var count = $("[id*=subPrivs] input:checked").length;
        if (count == 0) return;
        $(this).parents("div.sp-page").find("[id*=PageViewPrivilege]").attr('checked', count > 0);
    })
</script>
    </div>
</div>
<div class="sms_foot">
<asp:HiddenField ID="hdRoleCode" runat="server" />
    <img src="../images/images_58.jpg" width="944" height="8" class="float_left" />
</div>
</asp:Content>